{% extends 'common/panel.html' %}

{% block panel %}
{% load humanize %}
{% load analysis_extras %}

<h3>Climate Change Vulnerabilities</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>
        <tr class="grey">
            <td colspan=2>
                <b>Human Vulnerabilities to Climate Change</b>
                <sup><a id="displayText" href="javascript:toggleDiv('human');">Learn More</a><sup>
                <div id="human" style="display: none">
                    <p>This report is an indicator of the Global Climate-Demography Vulnerability Index (CDVI) which is 
                       estimated by subtracting climate vulnerabilities from demographic annual growth rates.  
                       In this case, high vulnerability is predicted for regions where a decline in climate conditions 
                       currently supporting high population density is combined with rapid population growth.
                    <p>CDVI < -12 is considered Low,
                    <p>-12 <= CDVI < -4 is Moderately Low,
                    <p>-4 <= CDVI < 4 is Moderate,
                    <p>4 <= CDVI < 12 is Moderately High,
                    <p>and CDVI >= 12 is considered High. 
                    <p>More information on this dataset can be found <a href="http://chairedb.uqar.qc.ca/documents/2011Samsonetal.GEB.pdf" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan=2>
                {% if climate_impact == default_value %}
                    No Data Available
                {% else %}
                    {{climate_impact.0}} (CDVI = {{climate_impact.1|floatformat:1}})
                {% endif %}
            </td>
        </tr>
        <tr class="grey">
            <td colspan=2>
                <b>Impact on Temperature</b>
                <sup><a id="displayText" href="javascript:toggleDiv('temp_change');">Learn More</a><sup>
                <div id="temp_change" style="display: none">
                    <p>This report represents anticipated temperature changes by end of century and was created by Ecotrust solely for use
                       in the Bioregion Discovery Tool reports section.  
                    <p>The results reflect a mean change in temperature between 2010 and 2050, using the International Panel on 
                       Climate Change's <a href="http://www.ipcc.ch/ipccreports/sres/emission/index.php?idp=98" target="_blank">scenario A2</a>.
                       This research uses data provided by the <a href="http://www.ccsm.ucar.edu" target="_blank">Community Climate System Model project</a>, 
                       supported by the Directorate for Geoscience of the National Science Foundation and the Office of Biological and Environmental Research
                       of the U.S. Department of Energy.  NCAR GIS Initiative provided CCSM data in the GIS format through 
                       <a href="http://www.gisclimatechange.org" target="_blank">GIS Climate Change Scenarios portal</a>.
                    <p>The data this research was based on can be found <a href="http://www.gisclimatechange.org/startPage.do" target="_blank">here</a>.
                    <p>NOTE:  Due to the nature of predictive modeling and the inherent complexities of unseen climatic variables, the results
                       of this analysis are only meant to serve as a rough calculation of potential changes in temperature over time. 
                </div>
            </td>
        </tr>
        <tr>
            <td colspan=2>
                {% if temp_change == default_value %}
                    No Data Available
                {% else %}
                    {% if temp_change == 0 %}
                        No change in Temperature is anticipated by 2050
                    {% else %}
                        {% if temp_change > 0 %}
                            Increase of 
                        {% endif %}
                        {% if temp_change < 0 %}
                            Decrease of 
                        {% endif %}
                        {{temp_change.0|floatformat:1}}&deg; Celsius / {{temp_change.1|floatformat:1}}&deg; Fahrenheit 
                        by 2050
                    {% endif %}
                {% endif %}
            </td>
        </tr>
        <tr class="grey">
            <td colspan=2>
                <b>Impact on Agricultural Production</b>
                <sup><a id="displayText" href="javascript:toggleDiv('ag_prod');">Learn More</a><sup>
                <div id="ag_prod" style="display: none">
                    <p>This report represents the expected impacts that climate change will have on terrestrial agriculture.  
                    <p>The data was created by the International Institute for Applied Systems Analysis (IIASA) and the Food and Agriculture
                       Organization (FAO) of the United Nations for the Global Agro-ecological Assessment for Agriculture in the 21st Century.
                       Data is from Plate 69 of this report.  
                    <p>More information on this dataset can be found <a href="http://www.iiasa.ac.at/Research/LUC/SAEZ/index.html" target="_blank">here</a>.
                </div>
            </td>
        </tr>
            {% if ag_impacts.0 == default_value %}
            <tr>
                <td colspan=2>
                    No Data Available
                </td>
            </tr>
            {% else %}
            {% for impact in ag_impacts %}
                {% if impact.0 == 'No Data' %}
                <tr>
                    <td colspan=2>
                        {{impact.1|percentage:0}} of this region is not covered by this dataset
                    </td>
                </tr>
                {% else %}
                <tr>
                    <td colspan=2>
                        {{impact.1|percentage:0}} of this region can expect {{impact.0}}
                    </td>
                </tr>
                {% endif %}
            {% endfor %}
            {% endif %}
        <tr class="grey">
            <td colspan=2>
                <b>Impact on Precipitation</b>
                <sup><a id="displayText" href="javascript:toggleDiv('water');">Learn More</a><sup>
                <div id="water" style="display: none">
                    <p>This report represents anticipated precipitation changes by end of century and was created by Ecotrust solely for use
                       in the Bioregion Discovery Tool reports section.  
                    <p>The results reflect a mean change in precipitation data between 2010 and 2099, using the International Panel on 
                       Climate Change's <a href="http://www.ipcc.ch/ipccreports/sres/emission/index.php?idp=98" target="_blank">scenario A2</a>.
                       This research uses data provided by the <a href="http://www.ccsm.ucar.edu" target="_blank">Community Climate System Model project</a>, 
                       supported by the Directorate for Geoscience of the National Science Foundation and the Offic of Biological and Environmental Research
                       of the U.S. Department of Energy.  NCAR GIS Initiative provided CCSM data in the GIS format through 
                       <a href="http://www.gisclimatechange.org" target="_blank">GIS Climate Change Scenarios portal</a>.
                    <p>The data this research was based on can be found <a href="http://www.gisclimatechange.org/startPage.do" target="_blank">here</a>.
                    <p>NOTE:  Due to the nature of predictive modeling and the inherent complexities of unseen climatic variables, the results
                       of this analysis are only meant to serve as a rough calculation of potential changes in precipitation over time. 
                </div>
            </td>
        </tr>
        {% if water_impacts.0 == default_value %}
        <tr>
            <td colspan=2>
                No Data Available
            </td>
        </tr>
        {% else %}
        {% for impact in water_impacts %}
        <tr>
            <td colspan=2>
                {{impact.1|percentage:0}} of this region can expect {{impact.0}}
            </td>
        </tr>
        {% endfor %}
        {% endif %}
    </tbody>
</table>
</div>
        

<h3>Rising Sea Levels</h3>
<h3 align="center">1 Meter</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>  
        <tr class="grey">
            <td colspan=2>
                <b>Estimated Loss of Land</b><sup><a id="displayText" href="javascript:toggleDiv('land_loss_1m');">Learn More</a><sup>
                <div id="land_loss_1m" style="display: none" align="center">
                    <p>The following report estimates the loss of land that would result from a 1 meter rise in sea levels.
                    <p>More information on the sea rise datasets can be found <a href="https://www.cresis.ku.edu/data/sea-level-rise-maps" target="_blank">here</a>.
                </div>
            </td>
        </tr>      
        <tr>
            <td colspan=2>
                {% if land_loss_1m.0 == 0 %}
                    None
                {% else %}
                    {{land_loss_1m.0|intcomma}} km<sup>2</sup> / {{land_loss_1m.1|intcomma}} mi<sup>2</sup>
                {% endif %}
            </td>
        </tr>
    </tbody>
</table>
</div>

<h3 align="center">3 Meter</h3>
<div class='freetext'>
<p>

<table  style='width:430px' class='analysis_report_container'>
    <tbody>  
        <tr class="grey">
            <td colspan=2>
                <b>Estimated Loss of Land</b><sup><a id="displayText" href="javascript:toggleDiv('land_loss_3m');">Learn More</a><sup>
                <div id="land_loss_3m" style="display: none" align="center">
                    <p>The following report estimates the loss of land that would result from a 3 meter rise in sea levels.
                    <p>More information on the sea rise datasets can be found <a href="https://www.cresis.ku.edu/data/sea-level-rise-maps" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan=2>
                {% if land_loss_3m.0 == 0 %}
                    None
                {% else %}
                    {{land_loss_3m.0|intcomma}} km<sup>2</sup> / {{land_loss_3m.1|intcomma}} mi<sup>2</sup></td>
                {% endif %}
        </tr>
    </tbody>
</table>
</div>

<h3 align="center">6 Meter</h3>
<div class='freetext'>
<p>
<table  style='width:430px' class='analysis_report_container'>
    <tbody>  
        <tr class="grey">
            <td colspan=2>
                <b>Estimated Loss of Land</b><sup><a id="displayText" href="javascript:toggleDiv('land_loss_6m');">Learn More</a><sup>
                <div id="land_loss_6m" style="display: none" align="center">
                    <p>The following report estimates the loss of land that would result from a 6 meter rise in sea levels.
                    <p>More information on the sea rise datasets can be found <a href="https://www.cresis.ku.edu/data/sea-level-rise-maps" target="_blank">here</a>.
                </div>
            </td>
        </tr>
        <tr>
            <td colspan=2>
                {% if land_loss_6m.0 == 0 %}
                    None
                {% else %}
                    {{land_loss_6m.0|intcomma}} km<sup>2</sup> / {{land_loss_6m.1|intcomma}} mi<sup>2</sup></td>
                {% endif %}
        </tr>
    </tbody>
</table>
</div>
<p>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
function toggleDiv(divId) {
   $("#"+divId).toggle();
}
</script>

<style type="text/css">
h3 { font-weight: bold; }
</style>

{% endblock panel %}
